import {Component} from 'react';
import WithRoute from '../router/withRoute';
class Info extends Component{
    render(){
        // let {name,price} = this.props.router.params;
        let {name,price} = this.props.router.location.state;
        return(
            <div>
                <h1>商品详情---{name}---{price}</h1>
                <button onClick={()=>{
                    // 跳转到上一个页面
                    this.props.router.navigate(-1)
                }}>返回上一页</button>
            </div>
        )
    }
}
export default WithRoute(Info);